//package pf.java.pfHelperBackup;
//
//import java.util.Iterator;
//
//import org.springframework.web.servlet.ModelAndView;
//import org.springframework.web.servlet.view.json.MappingJackson2JsonView;
//
//public class PFBaseWebController {
//    protected PFJsonData rdto;
////	private ModelAndView ViewData=new ModelAndView();
//	public PFViewDataDictionary ViewData=new PFViewDataDictionary();
//    public <TModel> ModelAndView View(TModel model,String viewName) {
//    	ViewData.SetModel(model);
//    	ModelAndView result= GetView();
////    	result.addObject("Model",model);
//    	result.addObject("Html", new HtmlHelperT<TModel>());
//    	result.setViewName(viewName);
//    	return result;
//    }
//    public ModelAndView View(String viewName) {
//    	ModelAndView result=GetView();
//    	result.addObject("Html",new HtmlHelper());
//    	result.setViewName(viewName);
//    	return result;
//    }
//    public <TModel> ModelAndView View(TModel model) {
//    	ViewData.SetModel(model);
//    	ModelAndView result=GetView();
//    	result.addObject("Html",new HtmlHelperT<TModel>());
//    	return result;
//    }
//    public ModelAndView View() {
//    	ModelAndView result=GetView();
//    	result.addObject("Html",new HtmlHelper());
//    	return GetView();
//    }
//    public ModelAndView Json(PFJsonData jsonData) {
//        ModelAndView mav = new ModelAndView(new MappingJackson2JsonView());  
//        mav.addObject("Result", jsonData.Result);  
//        mav.addObject("Url", jsonData.Url);  
//        return mav;  
//    }
//    public ModelAndView Json(AbstractApiResult<?> jsonData) {
//        ModelAndView mav = new ModelAndView(new MappingJackson2JsonView());  
//        mav.addObject("code", jsonData.code);  
//        mav.addObject("success", jsonData.success);  
//        mav.addObject("data", jsonData.data);  
//        return mav;  
//    }
//    private ModelAndView GetView() {
//    	ModelAndView result=new ModelAndView();
//
//  	  
//    	Iterator<String> iter = ViewData.keySet().iterator();
//    	  while(iter.hasNext()){
//    	   String key=iter.next();
//    	   Object value = ViewData.get(key);
//    	   result.addObject(key,value);
//    	   //System.out.println(key+" "+value);
//    	  }    	
//    	//如果要完全模仿C#的做法,就如下写:
//    	//result.addObject("ViewData",ViewData); 
//    	  
////    	  if(!result.getModelMap().containsKey("Html")) {
////    		  result.addObject("Html",new HtmlHelper());
////    	  }
////      	  if(!ViewData.containsKey("Html")) {
////      		  ViewData.put("Html",new HtmlHelper());
////      	  }
//    	return result;
//    }
//    protected ModelAndView RedirectToAction(String actionName, String controllerName) {
//    	return new ModelAndView("redirect:/"+controllerName+"/"+actionName);
//    }
//    protected ModelAndView RedirectToUrl(String url) {
//    	return new ModelAndView("redirect:"+url);
//    }
//}
